class Upgrade {
  late int platform; // 平台名称
  late String appVerisonName; // 版本名称
  late int appVerisonCode; // 版本号
  late int minVerisonCode; // 需升级的最小版本号
  late List<String> contents; // 升级内容
  late String url; // 应用市场地址

  // {
  //   'platform': 1, // 平台名称 1 iOS, 2 Android
  //   'appVerisonName': '1.0.1', // 版本名称
  //   'appVerisonCode': 2, // 版本号
  //   'minVerisonCode': 2, // 需升级的最小版本号
  //   'contents': [ // 升级内容
  //     '1、优化使用体验，使用更流畅',
  //     '2、修复了已知问题',
  //   ],
  //   'url': ''
  // }

  Upgrade({
    required this.platform,
    required this.appVerisonName,
    required this.appVerisonCode,
    required this.minVerisonCode,
    required this.contents,
    required this.url,
  });

  Upgrade.fromJson(Map<String, dynamic> json) {
    platform = json['platform'] as int;
    appVerisonName = json['appVerisonName'] as String;
    appVerisonCode = json['appVerisonCode'] as int;
    minVerisonCode = json['minVerisonCode'] as int;
    contents = json['contents'] as List<String>;
    url = json['url'] as String;
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['platform'] = platform;
    data['appVerisonName'] = appVerisonName;
    data['appVerisonCode'] = appVerisonCode;
    data['minVerisonCode'] = minVerisonCode;
    data['contents'] = contents;
    data['url'] = url;
    return data;
  }
}
